package example.runner;

import service.network.NetworkManageService;
import materials.network.AbstractNetworkCreation;
import materials.network.NetworkCreation;
import materials.network.NetworkInterface;
import materials.network.NeuronalNetwork;
import materials.neurons.Neurons;

/**
 * Nur zum Netze erstellen gedacht.
 *
 * @author Ramox
 *
 */
public class GutesNetz extends AbstractNetworkCreation
{
       
       
        public GutesNetz(){
                createNet();
        }
        /**
         * erstellt ein neues zufÃ¤lliges Netz
         *
         * die Neuronen sind so eingeteilt:
         * 25-25-8
         * mit sigmoid funktionen
         *
         * @return neues Netz
         */
        private void createNet()
        {
                NetworkInterface n = new NeuronalNetwork();

                NetworkManageService nms = new NetworkManageService(n);

                nms.raiseLayer();
                nms.raiseLayer();
                //nms.raiseLayer();

                for (int i = 1; i < 26; i++)
                {
                        nms.addNeuronToNetwork(1, "a"+i, Neurons.Linear);
                }

                for (int i = 26; i < 34; i++)
                {
                        nms.addNeuronToNetwork(2, "a"+i, Neurons.Sigmoid);
                }

                nms.connectTwoNeurons(1 ,"a1", "a26");
                nms.setWeightOfTwoNeurons(1 ,"a1", "a26", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a2", "a26");
                nms.setWeightOfTwoNeurons(1 ,"a2", "a26", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a2", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a2", "a27", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a3", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a3", "a27", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a4", "a28");
                nms.setWeightOfTwoNeurons(1 ,"a4", "a28", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a4", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a4", "a27", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a5", "a28");
                nms.setWeightOfTwoNeurons(1 ,"a5", "a28", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a6", "a26");
                nms.setWeightOfTwoNeurons(1 ,"a6", "a26", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a6", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a6", "a33", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a7", "a26");
                nms.setWeightOfTwoNeurons(1 ,"a7", "a26", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a7", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a7", "a33", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a7", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a7", "a27", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a8", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a8", "a27", Math.random()-0.5);

                nms.connectTwoNeurons(1 ,"a9", "a27");
                nms.setWeightOfTwoNeurons(1 ,"a9", "a27", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a9", "a28");
                nms.setWeightOfTwoNeurons(1 ,"a9", "a28", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a9", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a9", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a10", "a28");
                nms.setWeightOfTwoNeurons(1 ,"a10", "a28", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a10", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a10", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a11", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a11", "a33", Math.random()-0.5);

                nms.connectTwoNeurons(1 ,"a12", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a12", "a33", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a14", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a14", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a15", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a15", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a16", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a16", "a33", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a16", "a32");
                nms.setWeightOfTwoNeurons(1 ,"a16", "a32", Math.random()-0.5);
       
                nms.connectTwoNeurons(1 ,"a17", "a32");
                nms.setWeightOfTwoNeurons(1 ,"a17", "a32", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a17", "a33");
                nms.setWeightOfTwoNeurons(1 ,"a17", "a33", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a17", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a17", "a31", Math.random()-0.5);
       
                nms.connectTwoNeurons(1 ,"a18", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a18", "a31", Math.random()-0.5);
       
                nms.connectTwoNeurons(1 ,"a19", "a30");
                nms.setWeightOfTwoNeurons(1 ,"a19", "a30", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a19", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a19", "a31", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a19", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a19", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a20", "a30");
                nms.setWeightOfTwoNeurons(1 ,"a20", "a30", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a20", "a29");
                nms.setWeightOfTwoNeurons(1 ,"a20", "a29", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a21", "a32");
                nms.setWeightOfTwoNeurons(1 ,"a21", "a32", Math.random()-0.5);
       
                nms.connectTwoNeurons(1 ,"a22", "a32");
                nms.setWeightOfTwoNeurons(1 ,"a22", "a32", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a22", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a22", "a31", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a23", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a23", "a31", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a24", "a31");
                nms.setWeightOfTwoNeurons(1 ,"a24", "a31", Math.random()-0.5);
                nms.connectTwoNeurons(1 ,"a24", "a30");
                nms.setWeightOfTwoNeurons(1 ,"a24", "a30", Math.random()-0.5);
               
                nms.connectTwoNeurons(1 ,"a25", "a30");
                nms.setWeightOfTwoNeurons(1 ,"a25", "a30", Math.random()-0.5);
               
                addNet(n);
        }
} 